home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / dskut / billutil.zip / WINSKIP.ZIP / WINSKIP.C next >
C/C++ Source or Header  |  1992-12-17  |  952b  |  46 lines

  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <time.h>
  4.  
  5. void main()
  6. {
  7.     FILE *cfgfile;
  8.     time_t time1, time2;
  9.     int flag, timevar;
  10.     char ch[2];
  11.  
  12.     if( (cfgfile=fopen("c:\\winskip.cfg","r")) != NULL ) {
  13.         fgets(ch,2,cfgfile);
  14.         fclose(cfgfile);
  15.     }
  16.     else ch[0]='5';
  17.  
  18.     timevar=atoi(ch);
  19.     system("cls");
  20.     printf("\n\n\n                    Pressing any key within %d seconds",timevar);
  21.     printf("\n                     skips booting Microsoft Windows.\n");
  22.     sound(1440);
  23.     delay(200);
  24.     nosound();  
  25.     time1=time(NULL);
  26.     time2=time(NULL);
  27.     flag=0;
  28.     while( (difftime(time2,time1) < timevar) && (flag==0) ) {
  29.         flag=kbhit();
  30.         time2=time(NULL);
  31.     }
  32.     if( flag!=0 ) {
  33.         printf("\n\n                         Booting without Windows...\n");
  34.         delay(1000);
  35.         system("cls");
  36.         exit(1);
  37.         }
  38.     else {
  39.         printf("\n\n                           Booting with Windows...\n\n\n");
  40.         delay(1000);
  41.         system("cls");
  42.         exit(0);
  43.     }
  44. }
  45.  
  46.